package com.xiyu.service.vo.market.task.baseVO;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import jakarta.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import static com.xiyu.service.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import java.time.LocalDateTime;

/**
 * 邮件营销任务 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class MarketTaskBase {

    @Schema(description = "名称")
    @Size(max = 50, message = "名称长度不能超过50")
    private String name;

    @Schema(description = "主题")
    @Size(max = 1024, message = "主题长度不能超过1024")
    private String subject;

    @Schema(description = "发送人ID")
    private Long senderId;

    @Schema(description = "回复人ID")
    private Long replyId;

    @Schema(description = "是否定时发送")
    private Boolean isScheduled;

    @Schema(description = "发送时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime sendTime;

    @Schema(description = "任务编号")
    @Size(max = 50, message = "任务编号长度不能超过50")
    private String taskNo;

    @Schema(description = "状态")
    @Range(max = 100000000, message = "状态最大不能超过100000000")
    private Integer status;

    @Schema(description = "错误信息")
    @Size(max = 1024, message = "错误信息长度不能超过1024")
    private String errorMessage;

    @Schema(description = "发送数量")
    @Range(max = 100000000, message = "发送数量最大不能超过100000000")
    private Integer requestCount;

    @Schema(description = "送达数量")
    @Range(max = 100000000, message = "送达数量最大不能超过100000000")
    private Integer deliverCount;

    @Schema(description = "打开数量")
    @Range(max = 100000000, message = "打开数量最大不能超过100000000")
    private Integer openCount;

    @Schema(description = "点击数量")
    @Range(max = 100000000, message = "点击数量最大不能超过100000000")
    private Integer clickCount;

    @Schema(description = "发送数量")
    @Range(max = 100000000, message = "发送回复最大不能超过100000000")
    private Integer replyCount;

    @Schema(description = "无效数量")
    @Range(max = 100000000, message = "无效数量最大不能超过100000000")
    private Integer invalidCount;

}
